package com.projectName.www.dao;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

public class Y_J_find_dao {
    public static List<Vector> fill(ResultSet r, String name) throws  Exception {

        List<Vector>list =new ArrayList<>();
        while(r.next()) {
           String shopname=r.getString(1);
           String dishname=r.getString(2);
           if(dishname!=null){
               if(shopname.equals(name)||dishname.equals(name))
               {
                   Vector v=new Vector();
               v.add(shopname);
               v.add(dishname);
               v.add(r.getString(3));
               list.add(v);
               }
        }else
           {
               if(shopname.equals(name))
               {
                   Vector v=new Vector();
                   v.add(r.getString(1));
                   v.add("");
                   v.add(r.getString(3));
                   list.add(v);}
           }
        }
        return list;
    }
   public static ResultSet resultSet( ) throws Exception {
        String sql ="select * from message";
        return BaseDao.executeQuery(sql);

   }

}
